package cust;

public class CustomerBiz {
	String[] names = new String[10];

	public void addName(String name) {
		for (int i = 0; i < names.length; i++) {
			if (names[i] != null) {
				continue;
			} else {
				names[i] = name;
			}
		}
	}

	public void show() {
		for (int i = 0; i < names.length; i++) {
			if (names[i] != null) {
				System.out.print(names[i] + "  ");
			}
		}
	}

	public boolean search(String name) {
		for (int i = 0; i < names.length; i++) {
			if (names[i] != null) {
				if (names[i].equals(name)) {
					return true;
				}
			}
		}
		return false;
	}

	public boolean search2(int s, int e, String name) {
		for (int i = s; i < e; i++) {
			if (names[i] != null && names[i].equals(name)) {
				return true;
			}
		}
		return false;
	}

	public void change(String oldName, String newName) {
		for (int i = 0; i < names.length; i++) {
			if (names[i] != null) {
				if (names[i].equals(oldName)) {
					names[i] = newName;
					break;
				}
			}
		}
	}
}
